package acwing;

import java.io.*;
import java.util.*;

public class ac886 {
    static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
    static final int N = 110;
    static int n, cnt;
    static int[] a = new int[N];
    static boolean[] st = new boolean[N];

    static int cin() throws IOException {
        in.nextToken();
        return (int) in.nval;
    }

    static boolean isPrime(int x) {
        if (x < 2) return false;
        for (int i = 2; i <= x / i; i ++ ) {
            if (x % i == 0) return false;
        }
        return true;
    }

    static void get_primes() {
        for (int i = 2; i <= N - 1; i ++ ) {
            if (!st[i]) a[cnt ++ ] = i;
            for (int j = 0; a[j] <= (N - 1) / i; j ++ ) {
                st[a[j] * i] = true;
                if (i % a[j] == 0) break;
            }
        }
    }

    public static void main(String[] args) throws IOException {
        n = cin();
        get_primes();
        for (int i = 0; i < n; i ++ ) {
            int x = cin();
            if (isPrime(x)) out.println("Yes");
            else out.println("No");
        }
        out.close();
    }
}